import { createApp } from 'vue'
import App from './App.vue'
import {getRegion} from '@/api'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';

(async () => {
  const {data} = await getRegion();

  if (
    import.meta.env.DEV ||
    ['福建'].includes(data?.region) || data?.isWhite) {

      const app = createApp(App)
      app.use(Antd).mount('#app').$nextTick(async () => {
        // Remove Preload scripts loading
        postMessage({ payload: 'removeLoading' }, '*')
        // Use contextBridge
        window.ipcRenderer.on('main-process-message', (_event, message) => {
          console.log(message)
        })
      })
  }
})()
